package game.dlg
{
	import flash.display.Bitmap;
	
	import game.core.FLPoint;

	public class GamePoint extends GameDialog
	{
		[Embed(source="/../embeds/a007.png")]
		public static var RedPoint:Class;
		[Embed(source="/../embeds/a008.png")]
		public static var BluePoint:Class;
		[Embed(source="/../embeds/a009.png")]
		public static var WritePoint:Class;
		public var bmp:Bitmap;
		public var point:FLPoint;
		public function GamePoint()
		{
			super();
			init();
		}
		
		public function init():void
		{
			bmp = new Bitmap;
			this.addChild(bmp);
		}
		
		public function setPoint(p:FLPoint):void{
			this.point = p;
			onChange();
		}
		
		public function onChange():void
		{
			if(point.z == FLPoint.TWO)
			{
				bmp.bitmapData = new BluePoint().bitmapData;
			}else if(point.z == FLPoint.ONE){
				bmp.bitmapData = new RedPoint().bitmapData;
			}else{
				bmp.bitmapData = new WritePoint().bitmapData;
			}
		}
		
		public function onTouch():void
		{
			point.z = (point.z+1)%3;
			onChange();
		}
	}
}